/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.matezk.dms.things.model.query;

import cn.hutool.core.date.DatePattern;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import top.continew.starter.data.core.annotation.Query;
import top.continew.starter.data.core.enums.QueryType;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 设备事件查询条件
 *
 * @author 程道林
 * @since 2025/01/06 17:46
 */
@Data
@Schema(description = "设备事件查询条件")
public class EventQuery implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 对应腾讯云事件ID
     */
    @Schema(description = "对应腾讯云事件ID")
    @Query(type = QueryType.EQ)
    private String eventId;

    /**
     * 部门ID
     */
    @Schema(description = "部门ID")
    @Query(type = QueryType.EQ)
    private Long deptId;

    /**
     * 设备ID
     */
    @Schema(description = "设备ID")
    @Query(type = QueryType.EQ)
    private String deviceId;

    /**
     * 关键字
     */
    @Schema(description = "关键字")
    @Query(type = QueryType.EQ)
    private String key;

    /**
     * 开始时间
     */
    @Schema(description = "事件时间", example = "2023-08-08,2023-08-08")
    @DateTimeFormat(pattern = DatePattern.NORM_DATE_PATTERN)
    @Size(max = 2, message = "操作时间必须是一个范围")
    private List<Date> eventTime;
}